Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Nov 21, 2025

This PR contains the following updates:

Package Change Age Confidence
org.springframework.boot:spring-boot-starter-parent (source) 4.0.0-RC1 -> 4.0.0 age confidence
org.springframework.boot:spring-boot-starter-parent (source) 4.0.0-RC2 -> 4.0.0 age confidence
org.springframework.boot:spring-boot-starter-parent (source) 4.0.0-M1 -> 4.0.0 age confidence

Release Notes

spring-projects/spring-boot (org.springframework.boot:spring-boot-starter-parent)

v4.0.0

Compare Source

v4.0.0-RC2

Compare Source

⭐ New Features
  • Restore support for Jersey now that it supports JAX-RS 4 (Jakarta EE 11) #​47967
  • Refactor OpenTelemetryLoggingAutoConfiguration from OpenTelemetrySdkAutoConfiguration #​47963
  • Switch property backing OnEnabledTracingExportCondition to management.tracing.export.{name}.enabled #​47959
  • Rename management.zipkin.tracing to management.tracing.export.zipkin #​47958
  • Switch property backing OnEnabledLoggingExportCondition to management.logging.export.{name}.enabled #​47957
  • Rename management.opentelemetry.logging.export properties #​47954
  • Split spring-boot-micrometer-tracing into Brave and OpenTelemetry specific module #​47953
  • Use Elasticsearch 9.2's elasticsearch-rest5-client in spring-boot-elasticsearch #​47945
  • Provide auto-configuration for Jackson's XML data format #​47942
  • Rename OnlyOnceLoggingDenyMeterFilter #​47925
  • Allow url to be specified when working with @AutoConfigureWebMvc configured HtmlUnit beans #​47857
🐞 Bug Fixes
  • Incorrect metadata for HttpServiceClientProperties ("spring.http.serviceclient") #​47943
  • Setting 'max-uri-tags' does not prevent unlimited meter growth on any AutoConfiguredCompositeMeterRegistry #​47924
  • Docker response 407 is not handled correctly resulting in no error message #​47901
  • Runtime hints for web resources no longer include nested folders #​47894
  • Auto-configuration for WebTestClient should be in an autoconfigure package #​47892
  • Jackson 2 support does not work in some sliced tests #​47869
  • spring-boot-starter-zipkin is missing spring-boot-micrometer-tracing dependency #​47866
  • Application TaskExecutor is no longer used when a custom AsyncConfigurer bean is defined #​47897
  • Custom Jackson serializers are no longer included in WebMvcTest and WebFluxTest #​47864
  • spring-boot-webtestclient is missing from GraphQL test starter #​47849
  • spring-boot-security brings test dependencies #​47813
  • @JsonTest and @AutoConfigureJson fail when using spring-boot-jackson2 #​47811
  • Message converter customizer ordering impedes overriding #​47798
  • Deprecated testcontainers implementations are no longer detected #​47796
  • reactor-test is missing from reactive test starters #​47795
  • spring-kafka-test is missing from spring-boot-starter-kafka-test #​47793
  • spring-batch-test is missing from spring-boot-starter-batch-test #​47792
  • spring-rabbit-test is missing from spring-boot-starter-amqp-test #​47791
  • App fails to start when using Actuator with Jackson 2 and without spring-web #​47788
  • Depending on spring-boot-starter-actuator without a tracing bridge results in empty and unwanted correlation IDs in the logs #​47785
  • spring-boot-maven-plugin process-aot goal does not find package-private main method #​47783
  • Templating auto-configurations still have enabled properties that are not relevant following modularization #​32250
📔 Documentation
  • Config property management.logging.export.enabled is missing from documentation #​47961
  • Add a section about upgrading to Spring Boot 4.x #​47916
  • BootstrapContext#getOrElseThrow has incorrect reference to IllegalStateException #​47906
  • Clarify when BootstrapContext get methods may return null rather than throwing an exception or calling the fallback supplier #​47899
  • Document that web clients are opt-in with @SpringBootTest #​47891
  • Document AssertJ support in RestTestClient #​47881
  • Document that Actuator endpoint may have at most one extension of each type #​47874
  • Limit Kotlin API documentation to Kotlin-specific APIs #​47860
  • Correct link to JacksonTester in JacksonTesterTestAutoConfiguration javadoc #​47784
🔨 Dependency Upgrades
❤️ Contributors

Thank you to all the contributors who worked on this release:

@​Walti91, @​filiphr, @​mipo256, @​namest504, @​ngocnhan-tran1996, @​siva-sai-udaygiri, and @​tschut


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Summary by CodeRabbit

Release Notes

  • Chores

    • Upgraded Spring Boot to 4.0.0 (stable release).
    • Updated testing framework dependencies to use testcontainers.
  • Bug Fixes

    • Improved error responses with standardized, specific error type identifiers for duplicate resources, not-found, and validation errors.
    • Added handling for missing request value exceptions.
  • Documentation

    • Updated MongoDB configuration property names and connection parameters in guides.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 21, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR upgrades the boot-mongodb-elasticsearch module from Spring Boot 4.0.0-M1 to the stable 4.0.0 release, replacing test dependencies with their updated equivalents, migrating imports to newer libraries (tools.jackson, JSpecify), updating MongoDB configuration property namespaces, and enhancing exception handling with standardized error type URIs.

Changes

Cohort / File(s) Summary
POM Dependency Updates
boot-mongodb-elasticsearch/pom.xml, scheduler/boot-scheduler-quartz/pom.xml
Spring Boot parent bumped to 4.0.0; spring-boot-starter-aop replaced with spring-boot-starter-aspectj; test dependencies reorganized (spring-boot-starter-test → spring-boot-starter-webflux-test, reactor-test removed); testcontainers imports updated (junit-jupiter, mongodb, elasticsearch); spring-boot-starter-actuator-test added to scheduler module
Configuration Property Migrations
boot-mongodb-elasticsearch/src/main/resources/application.properties, application-cluster.properties, README.md
MongoDB property keys renamed from spring.data.mongodb.* to spring.mongodb.*; README updated with new property names and MongoDB URI parameters (readPreference, directConnection)
Exception Handler Enhancements
boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
Class annotated with @Order(Ordered.HIGHEST_PRECEDENCE); exception handler return types updated to Mono<@nonnull ProblemDetail>; error type URIs set for duplicate-restaurant, restaurant-not-found, and validation-error; new handler added for MissingRequestValueException
Import Path Migrations: Jackson & Testcontainers
boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/document/Grades.java, src/test/java/com/example/mongoes/common/ContainersConfig.java, src/test/java/com/example/mongoes/model/request/RestaurantRequestTest.java
Jackson imports migrated from com.fasterxml.jackson to tools.jackson; testcontainers MongoDBContainer import corrected; SpringDataJacksonConfiguration replaced with SpringDataJackson3Configuration
Test Annotation Import Migrations
boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/AbstractIntegrationTest.java, src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java, src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
AutoConfigureWebTestClient and WebFluxTest imports updated to Spring Boot 4.0 paths
Null-Safety & Bean Configuration Updates
scheduler/boot-scheduler-quartz/src/main/java/com/example/mongoes/config/WebMvcConfig.java, boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/WebFluxConfig.java
NonNull annotation migrated from org.springframework.lang to org.jspecify.annotations; GeoModule replaced with GeoJacksonModule; CORS configuration updated to parse comma-separated lists
Test Assertion Updates
boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java, RestaurantControllerTest.java, SearchControllerTest.java
Expected error type URIs in test payloads updated from "about:blank" to standardized URLs (https://api.mongoes.com/errors/*)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–25 minutes

  • GlobalExceptionHandler enhancements — Review null-safety annotations, error type URIs, and new MissingRequestValueException handler for correctness
  • WebFluxConfig bean refactoring — Verify GeoJacksonModule replacement and CORS string-parsing logic work as intended
  • Test assertion updates — Ensure all error type URIs match the new standardized format across multiple test files
  • Configuration property consistency — Confirm MongoDB property key migrations are complete and consistent across all config files

Possibly related issues

Possibly related PRs

Poem

🐰 From milestone springs we hop to stable ground,
Four-point-oh calls us forward, no delays—
Exception types now wear their URIs proud,
While beans dance swift with Geo's newest ways,
A well-coordinated Spring refresh complete! 🌱

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.85% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: updating Spring Boot parent dependency to v4.0.0, which aligns with the main objective and the bulk of the changeset modifications.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 72eca7e and 9c0b992.

📒 Files selected for processing (15)
  • boot-mongodb-elasticsearch/README.md (1 hunks)
  • boot-mongodb-elasticsearch/pom.xml (3 hunks)
  • boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java (3 hunks)
  • boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/WebFluxConfig.java (2 hunks)
  • boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/document/Grades.java (1 hunks)
  • boot-mongodb-elasticsearch/src/main/resources/application-cluster.properties (1 hunks)
  • boot-mongodb-elasticsearch/src/main/resources/application.properties (1 hunks)
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/AbstractIntegrationTest.java (1 hunks)
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/ContainersConfig.java (1 hunks)
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/model/request/RestaurantRequestTest.java (1 hunks)
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java (3 hunks)
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java (10 hunks)
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java (11 hunks)
  • scheduler/boot-scheduler-quartz/pom.xml (1 hunks)
  • scheduler/boot-scheduler-quartz/src/main/java/com/scheduler/quartz/config/WebMvcConfig.java (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@renovate renovate bot force-pushed the renovate/spring-boot branch from b2728ec to f698294 Compare November 23, 2025 05:34
@renovate
Copy link
Contributor Author

renovate bot commented Nov 23, 2025

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

@rajadilipkolli
Copy link
Owner

@coderabbitai, full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 23, 2025

@rajadilipkolli: I'll perform a full review of this Spring Boot 4.0.0 upgrade PR. Given that this is a major version upgrade, I'll carefully examine all changes for potential breaking changes, migration requirements, and compatibility issues.

✅ Actions performed

Full review triggered.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java (1)

26-32: Add custom error type URLs for business exceptions to align with RFC 7807 best practices.

Validation errors (WebExchangeBindException, ConstraintViolationException, MissingRequestValueException) all set custom type URLs via setType(URI.create("https://api.mongoes.com/errors/validation-error")), but business exceptions (DuplicateRestaurantException and RestaurantNotFoundException) do not. RFC 7807 recommends using absolute URIs (http/https) as the "type" value and preferring dereferenceable locators under your API domain. For consistency and proper RFC 7807 compliance, add custom type URIs for business exceptions:

  • DuplicateRestaurantException (409): https://api.mongoes.com/errors/conflict
  • RestaurantNotFoundException (404): https://api.mongoes.com/errors/not-found

Add problemDetail.setType(URI.create(...)) in handlers at lines 26–32 and 34–39.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 72eca7e and 9bf3a45.

📒 Files selected for processing (13)
  • boot-mongodb-elasticsearch/pom.xml (3 hunks)
  • boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java (3 hunks)
  • boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/document/Grades.java (1 hunks)
  • boot-mongodb-elasticsearch/src/main/resources/application-cluster.properties (1 hunks)
  • boot-mongodb-elasticsearch/src/main/resources/application.properties (1 hunks)
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/AbstractIntegrationTest.java (1 hunks)
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/ContainersConfig.java (1 hunks)
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/model/request/RestaurantRequestTest.java (1 hunks)
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java (3 hunks)
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java (10 hunks)
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java (11 hunks)
  • scheduler/boot-scheduler-quartz/src/main/java/com/scheduler/quartz/config/WebMvcConfig.java (1 hunks)
  • scheduler/boot-scheduler-quartz/src/main/resources/application.properties (1 hunks)
🧰 Additional context used
🧠 Learnings (22)
📓 Common learnings
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1556
File: boot-mongodb-elasticsearch/pom.xml:8-8
Timestamp: 2024-12-05T12:32:53.939Z
Learning: Spring Boot 3.4.0 was released on 21st November 2024 and is considered a stable release suitable for production use.
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1613
File: jpa/boot-jpa-jooq-sample/pom.xml:6-10
Timestamp: 2025-01-05T17:50:10.344Z
Learning: Spring Boot 3.4.1 was released on 2024-12-20 and is thus a valid version to use.
📚 Learning: 2025-01-18T20:21:22.956Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1660
File: boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java:34-34
Timestamp: 2025-01-18T20:21:22.956Z
Learning: In boot-mongodb-elasticsearch project, data synchronization between MongoDB and Elasticsearch is asynchronous through a change stream processor. Integration tests that create data in MongoDB should wait for the data to be indexed in Elasticsearch before querying it.

Applied to files:

  • boot-mongodb-elasticsearch/src/main/resources/application.properties
  • boot-mongodb-elasticsearch/pom.xml
  • boot-mongodb-elasticsearch/src/main/resources/application-cluster.properties
📚 Learning: 2025-01-17T17:53:29.524Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1658
File: boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/web/controller/RestaurantController.java:41-41
Timestamp: 2025-01-17T17:53:29.524Z
Learning: In Spring WebFlux applications, use WebTestClient for testing reactive endpoints with validation constraints. The WebFluxTest annotation is preferred for controller layer tests as it configures only the web layer components.

Applied to files:

  • boot-mongodb-elasticsearch/pom.xml
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/AbstractIntegrationTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
📚 Learning: 2025-01-18T21:55:42.020Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1660
File: boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java:22-22
Timestamp: 2025-01-18T21:55:42.020Z
Learning: In Spring WebFlux integration tests with MongoDB and Elasticsearch, clean both databases in BeforeEach to ensure test independence, and use await().atMost() to handle asynchronous indexing operations.

Applied to files:

  • boot-mongodb-elasticsearch/pom.xml
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/AbstractIntegrationTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
📚 Learning: 2025-01-19T10:51:21.836Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1662
File: boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerIntTest.java:344-344
Timestamp: 2025-01-19T10:51:21.836Z
Learning: When testing Spring WebFlux endpoints that involve complex types like Pageable, WebClient can be used as an alternative to WebTestClient. WebClient provides better support for type serialization and more control over request/response handling.

Applied to files:

  • boot-mongodb-elasticsearch/pom.xml
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
📚 Learning: 2025-01-12T05:53:38.355Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1636
File: r2dbc/boot-r2dbc-json-column/src/main/java/com/example/learning/handler/PostHandler.java:32-46
Timestamp: 2025-01-12T05:53:38.355Z
Learning: Integration tests for paginated endpoints in Spring WebFlux should verify:
1. Default pagination behavior
2. Custom page size and number
3. Response structure including metadata (totalElements, totalPages)
4. Edge cases like out-of-bounds pages
5. Data consistency across pages

Applied to files:

  • boot-mongodb-elasticsearch/pom.xml
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
📚 Learning: 2025-01-19T09:56:24.432Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1662
File: boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerIntTest.java:344-344
Timestamp: 2025-01-19T09:56:24.432Z
Learning: When testing Spring WebFlux endpoints that return Page/Pageable types using WebTestClient, a custom Jackson configuration is needed to handle Pageable serialization/deserialization properly.

Applied to files:

  • boot-mongodb-elasticsearch/pom.xml
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/model/request/RestaurantRequestTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
📚 Learning: 2025-01-19T11:03:29.462Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1662
File: boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerIntTest.java:344-344
Timestamp: 2025-01-19T11:03:29.462Z
Learning: When testing Spring WebFlux endpoints with complex response types, RestAssured can be used as an alternative to WebTestClient/WebClient. RestAssured provides better support for response validation and handles complex types like Pageable more effectively.

Applied to files:

  • boot-mongodb-elasticsearch/pom.xml
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/AbstractIntegrationTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/model/request/RestaurantRequestTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
📚 Learning: 2025-01-19T10:10:09.284Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1662
File: boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerIntTest.java:344-344
Timestamp: 2025-01-19T10:10:09.284Z
Learning: When using WebTestClient in Spring WebFlux tests, custom Jackson modules and codecs need to be configured by setting up ExchangeStrategies with proper Jackson2JsonEncoder and Jackson2JsonDecoder using the application's ObjectMapper.

Applied to files:

  • boot-mongodb-elasticsearch/pom.xml
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/model/request/RestaurantRequestTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
📚 Learning: 2025-01-17T17:54:44.123Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1658
File: boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/web/controller/RestaurantController.java:78-78
Timestamp: 2025-01-17T17:54:44.123Z
Learning: The RestaurantController in boot-mongodb-elasticsearch project uses validation annotations (Valid, NotNull, etc.) to validate request bodies for Grades and RestaurantRequest classes. The validation is tested using WebTestClient in integration tests.

Applied to files:

  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/AbstractIntegrationTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java
  • boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/model/request/RestaurantRequestTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
📚 Learning: 2025-01-18T15:13:34.660Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1659
File: boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/web/api/SearchApi.java:400-433
Timestamp: 2025-01-18T15:13:34.660Z
Learning: When testing REST endpoints with WebTestClient in Spring WebFlux, use WebTestClient's native assertion methods like `isEqualTo()` for JSON path assertions instead of combining with AssertJ's `assertThat()`.

Applied to files:

  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/AbstractIntegrationTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/model/request/RestaurantRequestTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
📚 Learning: 2025-01-15T05:52:47.347Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1650
File: jpa/boot-jpa-jooq-sample/src/test/java/com/example/learning/web/controller/PostControllerIntTest.java:227-227
Timestamp: 2025-01-15T05:52:47.347Z
Learning: In Spring Boot REST API tests, when asserting validation error responses:
1. The response should include standard problem detail fields (type, title, status, detail, instance)
2. Validation errors should be available in the 'violations' property as a list
3. Each violation should contain 'object', 'field', 'rejectedValue', and 'message' fields
4. Use AssertJ's satisfiesExactlyInAnyOrder to verify all violations regardless of their order

Applied to files:

  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java
  • boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
📚 Learning: 2025-01-17T18:36:11.357Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1658
File: boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/web/controller/SearchController.java:30-30
Timestamp: 2025-01-17T18:36:11.357Z
Learning: In Spring WebFlux controllers, use Validated at class level and parameter-level constraints (NotBlank, Min, Max, etc.) to validate request parameters. WebTestClient can be used to test validation failures by verifying Bad Request (400) responses.

Applied to files:

  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
  • boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
📚 Learning: 2025-01-12T13:45:58.565Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1642
File: r2dbc/boot-r2dbc-notify-listen/src/main/java/com/example/demo/listener/NotificationListener.java:67-67
Timestamp: 2025-01-12T13:45:58.565Z
Learning: In Spring WebFlux applications, use RestControllerAdvice instead of ControllerAdvice for exception handling, and ensure the handler methods return Mono/Flux to maintain the reactive flow. Additionally, use ResponseStatus to explicitly define the HTTP status code.

Applied to files:

  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
  • boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
📚 Learning: 2024-12-22T12:22:30.684Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1592
File: jpa/boot-data-customsequence/src/main/java/com/example/custom/sequence/mapper/CustomerMapper.java:51-51
Timestamp: 2024-12-22T12:22:30.684Z
Learning: Integration tests for CustomerController can showcase creation, update, and validation scenarios using "CustomerRequest" and verifying JSON fields in the response.

Applied to files:

  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/model/request/RestaurantRequestTest.java
📚 Learning: 2025-01-19T10:03:44.925Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1662
File: boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerIntTest.java:344-344
Timestamp: 2025-01-19T10:03:44.925Z
Learning: When testing Spring WebFlux endpoints with WebTestClient, ensure that all query parameters from the curl command are properly mapped in the test, especially when dealing with multiple values for the same parameter (like fieldNames). Use uriBuilder's queryParam method which supports varargs for multiple values.

Applied to files:

  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
📚 Learning: 2025-01-18T19:15:24.963Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1660
File: boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java:270-270
Timestamp: 2025-01-18T19:15:24.963Z
Learning: In WebFlux tests with WebTestClient, avoid using blocking operations like block(), blockFirst(), or blockLast() in parallel threads. Instead, use StepVerifier for non-blocking verification of reactive streams.

Applied to files:

  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
📚 Learning: 2025-01-12T13:49:28.393Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1642
File: r2dbc/boot-r2dbc-notify-listen/src/main/java/com/example/demo/listener/NotificationListener.java:67-67
Timestamp: 2025-01-12T13:49:28.393Z
Learning: In Spring WebFlux applications with Bean Validation, handle ConstraintViolationException globally using RestControllerAdvice to convert validation errors into HTTP 400 responses with problem details. Keep validation at the controller level using annotations like Pattern and NotBlank, rather than implementing it in the service layer.

Applied to files:

  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
  • boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
📚 Learning: 2025-01-17T17:59:28.669Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1658
File: boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/web/controller/RestaurantController.java:41-41
Timestamp: 2025-01-17T17:59:28.669Z
Learning: In Spring WebFlux applications, use RestControllerAdvice with WebExchangeBindException and ConstraintViolationException handlers to properly handle validation errors and return 400 Bad Request responses with detailed error messages.

Applied to files:

  • boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
  • boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
📚 Learning: 2025-01-12T13:38:22.905Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1642
File: r2dbc/boot-r2dbc-notify-listen/src/main/java/com/example/demo/listener/NotificationListener.java:67-67
Timestamp: 2025-01-12T13:38:22.905Z
Learning: In reactive applications, to handle HTTP 400 (Bad Request) responses, create a custom exception and handle it using a global exception handler (ControllerAdvice) instead of using ResponseStatusException directly in the service layer.

Applied to files:

  • boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
📚 Learning: 2025-01-18T16:58:56.828Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1659
File: boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/web/controller/RestaurantController.java:42-42
Timestamp: 2025-01-18T16:58:56.828Z
Learning: In Spring applications, business exceptions like `RestaurantNotFoundException` should be thrown from the service layer rather than the controller layer to maintain separation of concerns and improve code reusability. Controllers should focus on HTTP protocol concerns while services handle business logic.

Applied to files:

  • boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
📚 Learning: 2025-01-12T07:34:53.917Z
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1636
File: r2dbc/boot-r2dbc-json-column/src/main/java/com/example/learning/handler/PostHandler.java:40-40
Timestamp: 2025-01-12T07:34:53.917Z
Learning: In Spring WebFlux applications, pagination parameters should be strictly validated by throwing ResponseStatusException with BAD_REQUEST status for negative page numbers and non-positive page sizes, along with descriptive error messages, instead of silently using default values.

Applied to files:

  • boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
🧬 Code graph analysis (1)
boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java (1)
boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java (1)
  • WebFluxTest (30-514)
🪛 GitHub Actions: boot-mongodb-elasticsearch
boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java

[error] 1-1: Test failed because the POST /api/restaurant returned 500 instead of expected 201 CREATED. The root cause is the same deserialization error of 'Point'.


[error] 1-1: Multiple test failures in RestaurantControllerIntTest: createRestaurant_WithDuplicateName_ShouldReturnConflict, findAllRestaurants_ShouldReturnPagedResults, findRestaurantById_WithNonExistentId_ShouldReturnNotFound, findRestaurantByName_WithExistingName_ShouldReturnRestaurant, totalCount_ShouldReturnNumberOfRestaurants, updateGradesOfRestaurant_ShouldUpdateAllGrades, addGradeToRestaurant_ShouldAddNewGrade all failed due to 500 errors.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (21)
boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/document/Grades.java (1)

7-8: The review comment is incorrect—the imports are valid for Spring Boot 4.0.0 with Jackson 3.

Jackson 3.x uses the package tools.jackson.databind, and in Jackson 3, annotations like @JsonDeserialize and @JsonPOJOBuilder are relocated to tools.jackson.databind.annotation. The imports on lines 7–8 of Grades.java are correct:

  • tools.jackson.databind.annotation.JsonDeserialize is the proper location in Jackson 3
  • tools.jackson.databind.ext.javatime.deser.LocalDateTimeDeserializer is the proper location for the time deserializer in Jackson 3

No changes are needed. The codebase is correctly configured for Spring Boot 4.0.0, which uses Jackson 3.

Likely an incorrect or invalid review comment.

boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/model/request/RestaurantRequestTest.java (1)

16-20: Update to SpringDataJackson3Configuration aligns with Spring Data 4 / Jackson 3

Switching the import and @Import from SpringDataJacksonConfiguration to SpringDataJackson3Configuration is the correct move for Spring Data 4.0+ and Jackson 3. Verification confirms no lingering references to the deprecated configuration class exist in the codebase, and the new config is correctly in place and used only in this test file. Change is approved.

boot-mongodb-elasticsearch/src/main/resources/application-cluster.properties (1)

2-2: Property rename is correct and consistent across profiles.

The MongoDB URI property has been properly renamed from spring.data.mongodb.uri to spring.mongodb.uri, which is the documented migration change for Spring Boot 4.0. Both application.properties and application-cluster.properties consistently use the new namespace.

Note: The cluster profile configuration file exists but is not referenced or tested in the codebase. Ensure the cluster setup is validated with integration tests to confirm that the MongoDB replica set connection parameters work correctly in your deployment environment.

boot-mongodb-elasticsearch/pom.xml (5)

22-22: No action required.

Spring Boot 4.0.0 provides first-class support for Java 25, so the project configuration is correct.


102-112: Testcontainers artifact names are version-dependent; verify actual Testcontainers version in use.

Testcontainers 2.0.x uses the artifact names testcontainers-junit-jupiter, testcontainers-mongodb, and testcontainers-elasticsearch, which match the pom.xml changes shown. However, Testcontainers 1.x uses simpler names: junit-jupiter, mongodb, and elasticsearch without the prefix.

Confirm which Testcontainers version Spring Boot 4.0.0 manages by checking the actual version property in the pom.xml file or verifying against Spring Boot 4.0.0's dependency management. If using Testcontainers 2.0.x, the artifact names are correct; if using 1.x, they must be updated to remove the testcontainers- prefix.


51-51: Confirm the change is valid for Spring Boot 4.0 migration; no further configuration changes required for existing Spring AOP usage patterns.

In Spring Boot 4.0, spring-boot-starter-aop has been renamed to spring-boot-starter-aspectj. This is a mandatory rename for Spring Boot 4.0 compatibility. The migration guide advises reviewing if you actually need the starter before using the replacement, and if your application does not use AspectJ annotations (from the org.aspectj.lang.annotation package), you probably do not need the starter at all.

However, the boot-mongodb-elasticsearch module does use AspectJ annotations (as evidenced by the LoggingAspect class with @aspect, @pointcut, @AfterThrowing, and @around). The change to spring-boot-starter-aspectj is the correct rename for Spring Boot 4.0. No additional configuration changes are required—the module is already using Spring AOP patterns that work seamlessly with the renamed starter.


92-92: No issues found—webflux-test starter is appropriate and complete.

The spring-boot-starter-webflux-test starter includes reactor-test and transitively pulls in spring-boot-starter-test (which supplies JUnit/JUnit Jupiter). All essential test dependencies (JUnit Jupiter, AssertJ, Mockito, reactor-test) are available, making this a correct and optimized choice for your WebFlux-based application.


9-9: Spring Boot 4.0.0 is GA (Nov 20, 2025) and production-ready.

Static analysis shows the codebase is well-prepared: no javax imports detected, controllers properly use @RestController, and Jackson 3 is already configured. However, verify the following before deployment:

  • Run full integration tests to confirm reactive WebFlux, MongoDB, and Elasticsearch operations work correctly with Spring Boot 4's Jakarta migration and Spring Framework 7 changes
  • Confirm springdoc-openapi 3.0.0 is compatible with Spring Boot 4 (verify OpenAPI/Swagger generation works)
  • Test with actual Testcontainers MongoDB and Elasticsearch instances to catch transitive dependency issues

Breaking changes like Jakarta namespace migration and auto-config modularization are real but appear handled in this codebase. Focus testing on reactive stream behavior and data serialization/deserialization.

boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/ContainersConfig.java (1)

9-9: Fix incorrect import path for MongoDBContainer.

The MongoDB Testcontainer class lives in the containers package (org.testcontainers.containers.MongoDBContainer), not org.testcontainers.mongodb. The import at line 9 should be:

import org.testcontainers.containers.MongoDBContainer;

The current import path will fail at compilation.

⛔ Skipped due to learnings
Learnt from: rajadilipkolli
Repo: rajadilipkolli/my-spring-boot-experiments PR: 1660
File: boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java:22-22
Timestamp: 2025-01-18T21:55:42.020Z
Learning: In Spring WebFlux integration tests with MongoDB and Elasticsearch, clean both databases in BeforeEach to ensure test independence, and use await().atMost() to handle asynchronous indexing operations.
scheduler/boot-scheduler-quartz/src/main/java/com/scheduler/quartz/config/WebMvcConfig.java (1)

3-3: LGTM! Correct migration to JSpecify annotations.

The import change from org.springframework.lang.NonNull to org.jspecify.annotations.NonNull aligns with Spring Boot 4.0.0's adoption of JSpecify annotations for standardized nullability contracts.

boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/AbstractIntegrationTest.java (1)

9-9: LGTM! Import path updated for Spring Boot 4.0.0.

The import path change reflects Spring Boot 4.0.0's test package reorganization. The @AutoConfigureWebTestClient annotation functionality remains unchanged.

boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java (2)

75-75: LGTM! Error type URLs updated consistently.

The error type URL changes from "about:blank" to "https://api.mongoes.com/errors/validation-error" align with the GlobalExceptionHandler updates and maintain consistency across all validation error responses.

Also applies to: 246-246, 268-268


1-329: Incorrect — Point deserialization failure claim unsupported by repository inspection

Inspected boot-mongodb-elasticsearch: pom.xml uses Spring Boot 4.0.0; WebFluxConfig registers a GeoModule bean; Address.java uses org.springframework.data.geo.Point; Grades.java uses Jackson 3 (tools.jackson.*); RestaurantRequestTest imports SpringDataJackson3Configuration and tests instantiate Point programmatically. There is no evidence in the code of a missing Point deserializer or an obvious Spring Boot 4/Jackson incompatibility. Provide failing test logs (stack traces) and failing test names for further verification.

Likely an incorrect or invalid review comment.

boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java (2)

16-16: LGTM! WebFluxTest import updated for Spring Boot 4.0.0.

The import path change from org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest to org.springframework.boot.webflux.test.autoconfigure.WebFluxTest reflects Spring Boot 4.0.0's test package reorganization.


313-313: LGTM! Error type URLs consistently updated.

All validation error responses now use "https://api.mongoes.com/errors/validation-error" instead of "about:blank", maintaining consistency with the GlobalExceptionHandler implementation.

Also applies to: 351-351, 435-435, 465-465, 712-712, 738-738, 765-765, 800-800, 835-835, 870-870

boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java (2)

21-21: LGTM! WebFluxTest import updated for Spring Boot 4.0.0.

The import path change reflects Spring Boot 4.0.0's test package reorganization for WebFlux testing support.


82-82: LGTM! Error type URLs consistently updated.

All validation error responses now use the standardized validation-error type URL, aligning with the GlobalExceptionHandler updates.

Also applies to: 117-117, 139-139, 183-183, 207-207, 284-284, 319-319, 454-454, 496-496

boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java (4)

23-23: Good practice: Explicit precedence ordering.

Adding @Order(Ordered.HIGHEST_PRECEDENCE) ensures this exception handler takes precedence over other potential exception handlers, providing consistent error responses across the application.


27-28: LGTM! Enhanced null safety with JSpecify annotations.

The return type updates to Mono<@NonNull ProblemDetail> leverage JSpecify annotations for improved null safety contracts, aligning with Spring Boot 4.0.0's standardization on JSpecify.

Also applies to: 35-35, 42-42, 67-67, 89-89


45-47: LGTM! Standardized validation error responses.

The addition of custom error type URLs (https://api.mongoes.com/errors/validation-error) provides consistent, machine-readable error types for validation failures, improving API client error handling.

Also applies to: 70-72


88-94: Good addition: Handling missing request parameters.

The new MissingRequestValueException handler provides consistent error responses for missing required query parameters, aligning with the validation error format used throughout the application.

@rajadilipkolli
Copy link
Owner

@coderabbitai, full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 23, 2025

@rajadilipkolli: I'll perform a comprehensive full review of this Spring Boot 4.0.0 upgrade. This is a major version upgrade with significant changes including:

  • Property namespace migrations (MongoDB configuration)
  • Jackson library reorganization (new import paths)
  • Test framework updates (WebFluxTest, Testcontainers)
  • Dependency changes (AspectJ, various Spring modules)
  • Error handling standardization (custom validation error types)
  • Actuator endpoint access control (Quartz endpoint)
  • Annotation source changes (JSpecify adoption)

I'll examine all changes for breaking changes, migration requirements, compatibility issues, and best practices alignment.

✅ Actions performed

Full review triggered.

@rajadilipkolli rajadilipkolli merged commit 62d379e into main Nov 23, 2025
9 checks passed
@rajadilipkolli rajadilipkolli deleted the renovate/spring-boot branch November 23, 2025 18:11
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 23, 2025

@rajadilipkolli: I'll perform a comprehensive full review of this Spring Boot 4.0.0 upgrade PR, examining all changes across the codebase for compatibility issues, breaking changes, and migration requirements.

✅ Actions performed

Full review triggered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants